package cn.lll.vuehouse.controller;

import cn.lll.vuehouse.common.ResponseResult;
import cn.lll.vuehouse.common.ResponseStatus;
import cn.lll.vuehouse.dto.LogDto;
import cn.lll.vuehouse.service.LoginfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("log")
public class LogController {

    @Autowired
    LoginfoService loginfoService;

    // 获取当前页日志信息数据
    @GetMapping("getCurrentPageInfo")
    public ResponseResult getCurrentPageInfo( LogDto logDto){
        return loginfoService.getCurrentPageInfo(logDto);
    }

    // 批量删除日志信息
    @DeleteMapping("batchDeleteIds")
    public ResponseResult batchDeleteIds(@RequestBody List<Integer> ids){
        loginfoService.removeBatchByIds(ids);
        ResponseResult responseResult = new ResponseResult();
        responseResult.success(ResponseStatus.SUCCESS);
        return responseResult;
    }
}
